package com.b2b.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;

/**
 * User
 * @author dolyw.com
 * @date 2018/8/31 14:43
 */
@Data
@Table(name = "user")
@AllArgsConstructor
@NoArgsConstructor
public class User implements Serializable {

    private static final long serialVersionUID = 3342723124953988435L;

    @Id
    @GeneratedValue(generator = "JDBC")
    @Column(name = "user_Id")
    private Integer userId;

    @Column(name = "img_url")
    private String imgUrl;

    private String phone;

//    @NotNull(message = "用户名不能为空", groups = { UserEditValidGroup.class })
    @Column(name = "user_name")
    private String userName;

    //@NotNull(message = "密码不能为空", groups = { UserLoginValidGroup.class, UserEditValidGroup.class })
    private String password;

    /**
     * 注册时间
     */
    @Column(name = "register_time")
    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date regTime;

    private Character state;
}